package com.usian.service.impl;

import com.usian.mapper.CommodityMapper;
import com.usian.pojo.Commodity;
import com.usian.service.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommodityServiceImpl implements CommodityService {
    @Autowired
    CommodityMapper commodityMapper;

    @Override
    public List<Commodity> findAll() {
        return commodityMapper.findAll();
    }

    @Override
    public List<Commodity> findAllAnd() {
        return commodityMapper.findAllAnd();
    }

    @Override
    public Commodity findById(Integer cid) {
        return commodityMapper.findById(cid);
    }

    @Override
    public void saveUser(Commodity commodity) {
        commodityMapper.insert(commodity);
    }

    @Override
    public void updateUser(Commodity commodity) {
        commodityMapper.updateById(commodity);
    }

    @Override
    public void del(Integer cid) {
        commodityMapper.deleteById(cid);
    }

    @Override
    public List<Commodity> querystatus() {
        return commodityMapper.querystatus();
    }

    @Override
    public String chaxun(String cname) {
        return commodityMapper.chaxun(cname);
    }

    @Override
    public void updateByCStart(Commodity commodity) {
        commodityMapper.updateByCStart(commodity.getCid());
    }

@Override
    public void updateByCStartTo(Commodity commodity) {
        commodityMapper.updateByCStartTo(commodity.getCid());
    }

    @Override
    public void check(Integer cid) {
        commodityMapper.check(cid);
    }

    @Override
    public void shangjia(Integer cid) {
        commodityMapper.shangjia(cid);
    }

    @Override
    public void xiajia(Integer cid) {
        commodityMapper.xiajia(cid);
    }


}
